package com.example;//package com.example;

import com.example.user.service.AclPermissionService;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.Frame;
import org.bytedeco.javacv.Java2DFrameConverter;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

public class Test {

    public static void main(String[] args) {
        //TODD 自媒体密码
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        System.out.println(bCryptPasswordEncoder.encode("123"));
//        try {
//            FFmpegFrameGrabber ff = new FFmpegFrameGrabber("https://health-wanglijie.oss-cn-hangzhou.aliyuncs.com/WeChat_20231023190744.mp4");
//            ff.start();
//
//            Frame f  = null;
//
//            //传入的参数是秒，这里需要处理的时间戳是按微秒走的,需要转换一下
//            Double d = Double.parseDouble("2");
//            long targetFrameNum = (long) (d * 1000 * 1000);
//            ff.setTimestamp(targetFrameNum);
//
//            //根据传入的时间戳，抓取指定时间的视频关键帧
//            f = ff.grabImage();
//            if (f != null) {
//                //处理并生成图片
//                int owidth = f.imageWidth;
//                int oheight = f.imageHeight;
//                // 对截取的帧进行等比例缩放
//                int width = 800;
//                int height = (int) (((double) width / owidth) * oheight);
//                Java2DFrameConverter converter = new Java2DFrameConverter();
//                BufferedImage fecthedImage = converter.getBufferedImage(f);
//                BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
//                bi.getGraphics().drawImage(fecthedImage.getScaledInstance(width, height, Image.SCALE_SMOOTH),
//                        0, 0, null);
//                ImageIO.write(bi, "jpg", new File("C:\\Users\\Administrator\\Pictures\\5.png"));
////                InputStream inputStream = bufferedImageToInputStream(bi);
//
//            }
//
//            ff.stop();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }


    }
}

//import com.example.model.tencent.utils.TextModerationUtil;
//import com.tencentcloudapi.tms.v20201229.models.*;
//
//
//public class TextModeration
//{
//    public static void main(String [] args) {
//        TextModerationResponse resp = TextModerationUtil.uploadText("你他妈就是一个大傻逼");
//        System.out.println(TextModerationResponse.toJsonString(resp));
//    }
//}
